/**
 * @file Define the redis keys used by this project
 * 
 * @author Steve Gao<gaofu@parllay.com>
 */


const PREFIX_PLATFORM_AUTH = 'plat_auth:';
const PREFIX_PLATFORM_PRE_AUTH_CODE = 'plat_pre_auth_code:';
const PREFIX_CLIENT_AUTH = 'client_auth:';
const PREFIX_USER = 'user:';
const PREFIX_PLAN = 'plan:';

function platform_auth(appId) {
    return PREFIX_PLATFORM_AUTH + appId;
}

exports.platform_auth = platform_auth;

function client_auth(appId) {
    return PREFIX_CLIENT_AUTH + appId;
}

exports.client_auth = client_auth;

function platform_pre_auth_code(appId) {
    return PREFIX_PLATFORM_PRE_AUTH_CODE + appId;
}

exports.platform_pre_auth_code = platform_pre_auth_code;

function user_plan(userId) {
    return PREFIX_USER + userId + ".plan";
}

function plan_productions(planId) {
    return PREFIX_PLAN + planId + '.productions';
}

exports.user_plan = user_plan;

function system_configurations() {
    return 'system:configurations';
}

exports.system_configurations = system_configurations;

function dianping_job(shopId) {
    return `dianping:${shopId}.job`;
}

exports.dianping_job = dianping_job;